<template>
    <div id="NotFound">

        <h2>哎呀</h2>

        <h1 :style="{ backgroundImage: 'url(' + notFoundImg + ')' }">404</h1>

        <p>{{ randomAnswer() }}</p>

        <router-link :to="{name: 'home'}">回到首页</router-link>
    </div>
</template>

<script>
export default {
    name: "NotFound",
    data() {
        return {
            notFoundImg: require('@/assets/images/404notfound.jpg'),
            randomAnswer: function () {
                let answerList = [
                    '您要找的页面可能被外星人劫持了(＃°Д°)',
                    '您要找的页面可能飞到外星球了＞﹏＜',
                    '您要找的页面可能和您玩起了躲猫猫(～￣▽￣)～',
                    '您要找的页面可能去西天取经了(°ー°〃)',
                    '您要找的页面可能正在飞升渡劫(ง •_•)ง',
                    '您要找的页面可能被吃掉了〒▽〒',
                ]

                let randomNum = Math.floor(Math.random() * answerList.length)

                return answerList[randomNum]
            }
        }
    }
}
</script>

<style scoped>
    body{
        margin: 0;
        padding: 0;
        height: 100%;
        font-family: "montserrat", sans-serif;
        min-height: 100vh;
        background-image: linear-gradient(125deg, #6a89cc, #b8e994);
    }

    #NotFound{
        width: 100%;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        text-align: center;
        color: #343434;
    }
    #NotFound h1{
        font-size: 160px;
        margin: 0;
        font-weight: 900;
        letter-spacing: 20px;
        background: center no-repeat;
        -webkit-text-fill-color: transparent;
        -webkit-background-clip: text;
    }
    #NotFound p{
        font-size: 26px;
    }
    #NotFound a{
        text-decoration: none;
        background: rgba(231, 81, 58, 0.67);
        color: #ffffff;
        padding: 12px 24px;
        display: inline-block;
        border-radius: 25px;
        font-size: 16px;
        text-transform: uppercase;
        transition: 0.4s;
    }
    #NotFound a:hover{
        background: rgb(231, 81, 58);
    }
</style>
